evaluating functions from graph